<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html>
<html>
<%
	String message = (String) request.getAttribute("message");
%>
<head>
	<jsp:include page="./header.jsp" />
	
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Log In</title>
	<script>
		window.onload = function(){
			if("<%=message%>"!="" && "<%=message%>"!="null"){
				alert("<%=message%>");
			}
		}

		function summitLogInForm(url){
			if($('#username').val() == ""){
				alert("Please fill in username!");
				$('#username').focus();
				boo = false;
			}else if($('#password').val() == ""){
				alert("Please fill in password!");
				$('#password').focus();
				boo = false;
			}else{
				document.forms["loginSubmit"].method = "post";
				document.forms["loginSubmit"].action = "./"+url;
				document.forms["loginSubmit"].submit();
			}
		}
	</script>
</head>
<body>
	<div data-role="page" data-theme="a">

	<div data-role="header" >
		<h1>Log In</h1>
	</div><!-- /header -->

	<div data-role="content" >	
		<div data-role="fieldcontain">
			<form id="loginSubmit">
				<label for="username">Username:</label>
				<input type="text" name="username" id="username" />
				<label for="password">Password:</label>
				<input type="password"" name="password" id="password"/>
				<div data-role="button" data-theme="a" onclick="summitLogInForm('Login')">Submit</div>
			</form>
		</div>
	</div><!-- /content -->

	<div data-role="footer">
		<h4>IRS</h4>
	</div><!-- /footer -->
	</div><!-- /page -->
</body>
</html>